package domein;

import java.util.Observable;

/**
 * Observable class to notify GUI of receiving file update progress.
 *
 * @author Colin Bundervoet
 * @author Jeroen Pattyn
 */
public class ReceivingFileObservable extends Observable
{
    int progres;

    /**
     * Notifies GUI of current progress with a message.
     *
     * @param message message to be displayed
     * @param progres current progress.
     */
    public void update(String message, int progres) {
        this.progres = progres;
        setChanged();
        notifyObservers(message);
    }

    /**
     * Only notifies GUI of current progress.
     *
     * @param progres current progress.
     */
    public void update(int progres) {
        this.progres = progres;
        setChanged();
        notifyObservers();
    }

    /**
     * Returns progress as currently known in this object.
     *
     * @return integer representation of progress.
     */
    public int getProgres() {
        return progres;
    }
}
